package com.smart.carey.util;


import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonParser;

/**
 * @author yefei
 * @date 2017/11/30
 */
public class GsonUtil {

    private static Gson gson;
    private static JsonParser jsonParse;

    static {
        gson = new GsonBuilder()
                .enableComplexMapKeySerialization()
                .serializeNulls()
                .setPrettyPrinting()
                .disableHtmlEscaping()
                .setDateFormat("yyyy-MM-dd HH:mm:ss").create();
        jsonParse = new JsonParser();
    }

    public static Gson getGson() {
        return gson;
    }

    public static JsonParser getJsonParse() {
        return jsonParse;
    }
}
